Summary of Template Language
Statements
procedure categoryName.procedureName
end procedureName
declare name: type [= expression]
import name: type
export name: type [= expression]
variable = expression
variable += expression
variable -= expression
variable++
variable--
item.procedureName (paramName = expression ...)
if booleanExpression
elsif booleanExpression
else
end if
for each categoryName
end for
for each item in list
end for
for each 'ABCD' resource
end for
while booleanExpression
end while
Operators
- + - * /
- && ||
- < > <= >= = == != <>
Types
- bool
- int
- string
- graphicData
- file
- stream
- categoryName
- list of {string, int, or categoryName}
- dictionary of {stream or categoryName}
Built-in functions
With a few exceptions, the built-in functions operate on a
typed object. A call is of the form: object.function (arguments).
For functions that take a single argument, the argument is
an expression. For functions with more than one argument, the
arguments are named.
Example:
- declare source: file
- source.create (name = "test")
Supplying a named argument is equivalent to declaring a temporary
variable of the appropriate type. So the preceding example could be
written as:
- declare source: file
- declare name: string = "test"
- source.create ()
(no object)
- reportStatus (string)
- string = stringFromInt (int)
- int = intFromString (string)
- string = getDate ()
- string = getTime ()
- createFolder (name = string)
file
- close ()
- create (name = string, creator = int, filetype = int)
- debug (dbgMsg = string, dbgInt = int, dbgString = string, dbgBool = Boolean, dbgRef = ref, dbgCR = Boolean)
- genText ()
- open ()
- writeGraphicResource (graphic = graphicData, type = int, id = int, name = string)
- writeResource (stream = stream, type = int, id = int, name = string)
graphic
- int = getDataSize ()
- int = getType ()
- release ()
stream
- int = getPos ()
- moveTo (int)
- putAlignWord ()
- putByte (int)
- putLong (int)
- putCString (string)
- putPString (string)
- putShort (int)
- putStream (stream)
- bool = readResource (type = int, id = int, name = string)
- int = getRsrcID ()
- string = getRsrcName ()
- getAlignWord ()
- int = getByte ()
- int = getLong ()
- string = getCString ()
- string = getPString ()
- int = getShort ()
- int = getWord ()
dictionary of {stream or categoryName}
- add (key = stream or categoryName, value = int)
- bool = contains (stream or categoryName)
- int = fetch (stream or categoryName)
list of int
- addInt (int)
- addRef (ref)
- int = uniquifyInt (int)
list of string
- addString (string)
- string = uniquifyString (string)